Skip to content

red-check-runs-workspace-members/1: The red run of a workspace member's tests uses the workspace environment - #981

Merged
bwmatson merged 4 commits into
mainfrom
spec/red-check-runs-workspace-members/1
Nov 16, 2026
Merged

bwmatson merged 4 commits into
mainfrom
spec/red-check-runs-workspace-members/1

Conversation

@bwmatson

Copy link
Copy Markdown
Owner

Start here

Already verified by the pipeline

  • Tests were committed first and seen to fail first.
  • unit-test result: passed
  • Review took 1 review round

Review tier: full — the reviewer classified it full

Why

The red check runs a unit's new tests at the tests commit in a throwaway worktree with no installed environment. For a Python project that is the root of a uv workspace's folder tree it works: uv run pytest resolves the workspace root, whose dev group has pytest. For a project that is itself a workspace member (doc-intelligence-pipelines/document_intelligence, agent-assessment) it does not: from the member's folder uv run syncs only that member, which does not declare pytest, and fails with `Fai

… The full reason is in openspec/changes/red-check-runs-workspace-members/proposal.md.

What this pull request does

The red check now runs a uv workspace member's new tests in the workspace environment, so a member whose dependencies are installed only at the workspace level is no longer rejected because pytest fails to start.

  • The python-uv profile's red command, and its whole-file retry, use uv run --all-packages --frozen for a project that a workspace root above it within the checkout lists as a member and whose root has a uv.lock. Everything else keeps plain uv run.
  • Workspace membership comes from the existing lock lookup (workspace_lock), so the root's own project, a folder the root does not list, a member with its own lock and a workspace with no lock all keep today's command.
  • The push gate passes the project to the red command when the tests commit selects no test ids, as well as when it does, so the whole-file red run of a member also gets the workspace form.
  • New tests cover the member, non-member, no-lock and id-selection-with-retry commands, plus a gate-level case for both the by-id and the whole-file branch. The toolchain-profiles doc and the changelog describe the new form.

Based on main, with nothing unmerged beneath it — ready to merge whenever the checks look right.

Unit red-check-runs-workspace-members/1 of change red-check-runs-workspace-members, task group(s) 1.
Spec: openspec/changes/red-check-runs-workspace-members/ in the planning repo.

Assumptions

This unit assumes nothing unmerged: everything it builds on is already in main.

Verification

This is a unit-test unit: everything it needs is fakes, fixtures or throwaway containers, so GitHub Actions runs the whole of it. No e2e-test run was required.

Left for later

Approved, with these recorded rather than blocking:

  • No test runs the real uv run --all-packages --frozen pytest against a real uv workspace. The profile tests check the argv shape, and the gate test uses a profile that only tells the member command apart from the plain one. A scenario in tests/integration/test_profile_scenarios.py, with a member whose dependency is installed only at the workspace level, would show the red check reach pytest for real.

How this was built

Tests were committed first and seen to fail before any implementation existed; the commit order is checked mechanically; lint, formatting and types pass at the tip.


Opened by the spec-driven pipeline. The build agent never merges. The pipeline merges only
a unit review classified auto and policy allowed; a person merges any other, after checking
the stack order above.

…vironment

The tests come first and fail until the implementation.

The red check runs a unit's new tests at the tests commit in a throwaway worktree with no installed environment.

Unit: red-check-runs-workspace-members/1
…vironment

With this in, the tests of the previous commit pass.

The red check runs a unit's new tests at the tests commit in a throwaway worktree with no installed environment.

Unit: red-check-runs-workspace-members/1
…ironment (review round 1)

Unit: red-check-runs-workspace-members/1
@bwmatson bwmatson added change-red-check-runs-workspace-members The change this pull request belongs to checking In review, but its checks are still running review-full Review asks for a full read from a person in-review Built and waiting for human review and removed checking In review, but its checks are still running labels Nov 16, 2026
@bwmatson
bwmatson merged commit a53ab2b into main Nov 16, 2026
5 checks passed
@bwmatson
bwmatson deleted the spec/red-check-runs-workspace-members/1 branch November 16, 2026 18:00
@bwmatson bwmatson added settling Merged; waiting for its checks to complete and removed in-review Built and waiting for human review settling Merged; waiting for its checks to complete labels Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change-red-check-runs-workspace-members The change this pull request belongs to review-full Review asks for a full read from a person

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant